//
//  LDMyResumeCellIPersonInfoInAll.swift
//  DingDongZP
//
//  Created by LeMac on 16/12/27.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

import UIKit

class LDMyResumeCellIPersonInfoInAll: LDMyResumeBaseCellInAll {

    var nameLab:UILabel?
    var genderLab:UILabel?
    var experienceLab:UILabel?
    var weixinNoLab:UILabel?
    
    var titleArr = ["姓      名 : ","姓      别 : ","工作年限 : ","微 信 号 : "]
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupView()
    }
    
    override func updateView() {
        super.updateView()
        var newArr = titleArr
        
        newArr[0].appendContentsOf(model?.name ?? "")
        newArr[1].appendContentsOf(model?.sex ?? "")
        newArr[2].appendContentsOf(model?.experience ?? "")
        newArr[3].appendContentsOf(LDUserInfo.sharedInstance.userInfoModel!.weixin ?? "")
        
        setLabTitle(newArr)
    }
    
    func setLabTitle(arr:[String]) {
        
        nameLab?.text = arr[0]
        genderLab?.text = arr[1]
        experienceLab?.text = arr[2]
        weixinNoLab?.text = arr[3]
        
    }

    
    func setupView() {
        
        title = "基本信息"
        nameLab = UILabel.setDetailsLab(titleArr[0], fontSize: 14, titleColor: LDFontColor.DeepGray, Alignment: .Left)
        genderLab = UILabel.setDetailsLab(titleArr[1], fontSize: 14, titleColor: LDFontColor.DeepGray, Alignment: .Left)
        experienceLab = UILabel.setDetailsLab(titleArr[2], fontSize: 14, titleColor: LDFontColor.DeepGray, Alignment: .Left)
        weixinNoLab = UILabel.setDetailsLab(titleArr[3], fontSize: 14, titleColor: LDFontColor.DeepGray, Alignment: .Left)
        
        bgView?.addSubview(nameLab!)
        bgView?.addSubview(genderLab!)
        bgView?.addSubview(experienceLab!)
        bgView?.addSubview(weixinNoLab!)
        
        
        nameLab?.snp_makeConstraints(closure: { (make) in
            make.top.equalTo(LDMargin_V*2)
            make.left.equalTo(LDMargin_V*3)
            make.height.equalTo(LDMargin_V*6)
            make.right.equalTo(-LDMargin_V*2)
        })
        
        genderLab?.snp_makeConstraints(closure: { (make) in
            make.top.equalTo(nameLab!.snp_bottom)
            make.left.right.height.equalTo(nameLab!)
            
        })
        experienceLab?.snp_makeConstraints(closure: { (make) in
            make.top.equalTo(genderLab!.snp_bottom)
            make.left.right.height.equalTo(nameLab!)
            
        })
        weixinNoLab?.snp_makeConstraints(closure: { (make) in
            make.top.equalTo(experienceLab!.snp_bottom)
            make.left.right.height.equalTo(nameLab!)
            
        })
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
